package com.woniuxy.redenvelope.exception.handler;


import com.woniuxy.commons.request.ResponseResult;
import com.woniuxy.commons.request.StateCode;
import com.woniuxy.redenvelope.exception.RedException;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

@RestControllerAdvice
public class GlobalExceptionHandler {
    @ExceptionHandler(RedException.class)
    public ResponseResult<Boolean> handleCategoryHaveSubCategoryException(RedException e) {
        return new ResponseResult<>(StateCode.FAIL,e.getMessage(),false);
    }

}
